package lanou.a36ke_01.adapters.logonadapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

public class CommentAdapter extends FragmentPagerAdapter {

    ArrayList<Fragment> fragments;
    ArrayList<String> list;

    public void setList(ArrayList<String> list) {
        this.list = list;
    }

    public void setFragments(ArrayList<Fragment> fragments) {
        this.fragments = fragments;

    }

    public CommentAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments != null ? fragments.size() : 0;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return list.get(position);
    }
}
